import QtQuick 2.0
import QtQuick.Layouts

//Component{
//    id:myHome
    GridLayout {
        id: grid
        anchors.fill: parent
        columns: 3
        rows: 3
        columnSpacing: 20
        rowSpacing: 20

        property url myHomeLoaderUrl

        Item{//场景大卡片
            Layout.fillHeight:true
            Layout.fillWidth:true
            Layout.row: 0
            Layout.column: 0
            Layout.rowSpan: 2
            BigCard{
                id: bigCardComponent
                btnConfigs: [
                    { text: "温馨回家", img: "qrc:/icon/icon/m_back_home.svg" },
                    { text: "安全离家", img: "qrc:/icon/icon/m_leave_home.svg" },
                    { text: "全屋恒温", img: "qrc:/icon/icon/m_thermometer.svg" },
                    { text: "全屋除湿", img: "qrc:/icon/icon/m_dehumi.svg" },
                    { text: "全屋通风", img: "qrc:/icon/icon/m_wind.svg" },
                    { text: "更多场景", img: "qrc:/icon/icon/m_more_scene.svg" },
                ]
            }
        }

        MiddleCard{
            Layout.row: 0
            Layout.column: 1
            title:"家庭能耗"
            img:"qrc:/icon/icon/m_energy_conservation.svg"
            text1:"3度"
            text2:"今日用电"
            text3:"本月用电x度"
        }
        MiddleCard{
            Layout.row: 0
            Layout.column: 2
            title:"传感器"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        SecurityCard{
            Layout.row: 1
            Layout.column: 1
        }
        MiddleCard{
            Layout.row: 1
            Layout.column: 2
            title:"家庭网络"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        MiddleCard{
            Layout.row: 2
            Layout.column: 0
            title:"超级控制"
            img:"qrc:/icon/icon/leave_home.svg"
        }
        MiddleCard{
            Layout.row: 2
            Layout.column: 1
            title:"电梯预约"
            img:"qrc:/icon/icon/leave_home.svg"
        }

        Item{//两个小卡片
            Layout.fillHeight:true
            Layout.fillWidth:true
            Item{
                anchors.fill: parent
                RowLayout{
                    Layout.row: 2
                    Layout.column: 2
                    anchors.fill: parent
                    SmallCard{
                        id:smallCard1
                        Layout.fillHeight:true
                        Layout.fillWidth:true
                        Layout.row: 0
                        title:"设备"
                        img:"qrc:/icon/icon/m_device.svg"
                        Connections{
                            target: smallCard1
                            function onSmallCardClickedSig(title){
                                rootStackView.push(devicePage)
                            }
                        }
                    }
                    SmallCard{
                        id:smallCard2
                        Layout.fillHeight:true
                        Layout.fillWidth:true
                        Layout.row: 1
                        title:"场景"
                        img:"qrc:/icon/icon/m_more_scene.svg"
                        Connections{
                            target: smallCard2
                            function onSmallCardClickedSig(){
                                rootStackView.push(scenePage)
                            }
                        }
                    }
                }
            }
        }
    }
//}

